#切片
# L = ['huangliang','lihui','jianfei','hutao']
# r = []
# n = 1
# for i in range(n):
#     r.append(L[i])

# print(r)
# print(L[:3])
# print(L[:-2])
# L=list(range(100))
#print(L)
# print(L[:10:2])#前10个数，每两个取一个
# print(L[:10])#前10个数，-10:就是后10个数
# print(L[10:20])#前11-20的数
# print(L[::5])#所有的数，每5个数取一个数
# print(L[::])#与原list一样
# print((0,2,4,6,8,10)[:3])#tuple，上面是list
# print('ahsoiuhdfioahihfdoas'[:5])#字符串
#练习
# def trim(s):
#     for x in s:
#         if x == '  ':
#             s = s[7:]
#         else:break
#     for x in s:
#         if x in s :
#             s = s[:-8]
#         else:break
#     return s
# print(trim('dhisahdhfjgoejgoihsgoighiohb'))
